package com.lzw.breezeNovel.common.exception;



import com.lzw.breezeNovel.common.result.ResultCodeEnum;
import com.sun.istack.NotNull;
import lombok.Data;


/**
 * @author 清风明月
 * @Package com.lzw.breezeNovel.common.exception
 * @date 2025/2/27
 * @description Minio配置类
 */
@Data
@SuppressWarnings("all")
public class BaseException extends RuntimeException {
    //状态码
    private Integer code;
    //错误信息
    private String msg;

    //构造方法
    public BaseException(Integer code, String msg) {
        super(msg);
        this.code = code;
        this.msg = msg;
    }

    public BaseException( @NotNull ResultCodeEnum resultCodeEnum) {
        super(resultCodeEnum.getMessage());
        this.code = resultCodeEnum.getCode();
        this.msg = resultCodeEnum.getMessage();
    }
}
